Agents Class
The Agents class is the main entry point for managing multiple agents and their lifecycle within the xpander.ai platform.Constructor
configuration
([Configuration](/API reference/configuration), optional): SDK configuration. If not provided, uses environment variables.
Methods
alist()
Asynchronously retrieve a list of all agents.
AgentsListItem
](/API reference/agents/API reference/agents-list-item) objects containing agent summaries.
Example:
- [
ModuleException
](/API reference/exceptions): If the request fails or authentication is invalid.
list()
Synchronously retrieve a list of all agents.
AgentsListItem
](/API reference/agents/API reference/agents-list-item) objects containing agent summaries.
Example:
- [
ModuleException
](/API reference/exceptions): If the request fails or authentication is invalid.
aget(agent_id, version=None)
Asynchronously retrieve a specific agent by ID.
agent_id
(str): Unique identifier for the agentversion
(int, optional): Specific version of the agent to retrieve. If not provided, retrieves the latest version.
Agent
](/API reference/agents/API reference/agent) object with full configuration.
Example:
- [
ModuleException
](/API reference/exceptions): If the agent is not found or access is denied.
get(agent_id, version=None)
Synchronously retrieve a specific agent by ID.
agent_id
(str): Unique identifier for the agentversion
(int, optional): Specific version of the agent to retrieve. If not provided, retrieves the latest version.
Agent
](/API reference/agents/API reference/agent) object with full configuration.
Example:
- [
ModuleException
](/API reference/exceptions): If the agent is not found or access is denied.
Usage Examples
Complete Agent Management Workflow
Error Handling
Related Classes
- [
Agent
](/API reference/agents/API reference/agent): Individual agent with full capabilities - [
AgentsListItem
](/API reference/agents/API reference/agents-list-item): Agent summary from list operations - [
Configuration
](/API reference/configuration): SDK configuration
Related Modules
- [Tasks Module](/API reference/tasks): Task creation and management
- [Tools Repository](/API reference/tools): Tool integration and management
- [Knowledge Bases](/API reference/knowledge): Document management and search
- [Events Module](/API reference/events): Event-driven programming